
UploadPlug = function (path, obj, param) {
	if ($.isPlainObject(obj) && $.isEmptyObject(obj)) {
		$.extend(obj, {"width":400, "height":300, "imgId":"", "photoId":""});
	}
	var arg = WrapParam(param);
	var REO = window.showModalDialog(path + "/permit/upload/InitFrame.do" + arg, window, "dialogWidth:" + obj["width"] + "px;dialogHeight:" + obj["height"] + "px;status:yes;help:yes;scroll:yes");
	$("#" + obj["photoId"]).val(REO.src);
	if (obj["imgId"]) {
		$("#" + obj["imgId"]).attr("src", "");
		$("#" + obj["imgId"]).attr("src", path + REO.src);
	}
};

UploadImage = function (path, obj, param) {
	if ($.isPlainObject(obj) && $.isEmptyObject(obj)) {
		$.extend(obj, {"width":800, "height":400, "imgId":"", "photoId":""});
	}
	var arg = WrapParam(param);
	var REO = window.showModalDialog(path + "/permit/upload/InitFrame.do" + arg, window, "dialogWidth:" + obj["width"] + "px;dialogHeight:" + obj["height"] + "px;status:yes;help:yes;scroll:yes");
	
	if(typeof(REO)!="undefined"){
	if ($("#" + obj["photoId"])) {
	   $("#" + obj["photoId"]).val(REO.src);
	}
	if (obj["imgId"]) {
		$("#" + obj["imgId"]).attr("src", "");
		if(REO.src){
		$("#" + obj["imgId"]).attr("src", path + REO.src);
		}
	}
	}
	//$('#imgUpload').css('display','none');
    //$('#imgSure').css('display','block');
    //$('#imgCancel').css('display','block');
    
	//$('#hidden_qyslxxImages_imagePath').val($('#qyslxxImages_imagePath').val());
	
};
function WrapParam(param) {
	var arg = "";
	if ($.isPlainObject(param)) {
		if (!$.isEmptyObject(param)) {
			$.each(param, function (key, val) {
				arg += ((arg.indexOf("?") < 0 ? "?" : "&") + key + "=" + val);
			});
		}
	}
	return arg;
}

